import request from '@utils/request'
import { APIParams, APIResult } from '@utils/request/type'
import { ServerEnum } from '@/api/enum/server'
import { CardAlarm, CardAlarmDTO, CardDTO } from '@/api/entity/sim-card'

/**
 * 分页查询
 * @param params
 */
export const getSimCardListByPageAPI = (params: APIParams.Page<{
  // SIM卡号
  cardno?: string,
}>) => request.post<APIResult.Page<CardDTO[]>>(ServerEnum.System + '/card/pageByUser', params)

/**
 * 获取报警列表
 * @param params
 */
export const getSimCardAlarmListByPageAPI = (params: APIParams.Page<CardAlarmDTO>) => request.post<APIResult.Page<CardAlarm[]>>(ServerEnum.System + '/cardAlarm/page', params)

/**
 * 获取报警列表
 * @param params
 */
export const simCardAlarmSettingsAPI = (params: {
  ids: string[],
  alarm: number
}) => request.post(ServerEnum.System + '/card/batchUpdateAlarm', params)
